/**
 * @author 康文程
 * @date 2023-12-14 下午 08:13
 */
class Menu {
    judgementMenu(menuId) {
        return new Promise((resolve, reject) => {
            $.ajax({
                url: "/www.xiaomi.com/background/menu",
                method: "GET",
                data: {
                    menuId: menuId
                },
                success: function (response) {
                    resolve(response);
                },
                error: function (error) {
                    reject(error);
                }
            });
        });
    }

    /**
     * 查询职称
     * @param name
     * @return {Promise<unknown>}
     */
    getEmployee(name){
        return new Promise((resolve, reject) => {
            $.ajax({
                url: "/www.xiaomi.com/background/get/employee/and/departments",
                method: "GET",
                data: {
                    name:name
                },
                success: function (response) {
                    resolve(response);
                },
                error: function (error) {
                    reject(error);
                }
            });
        });
    }
}